package com.yxw.job.task.livevod;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.yxw.live_vod_facade.feign.ProductFeignClient;
import com.yxw.yxnet_cd_center.common.utils.BaseDateTime;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * 后台产品相关
 * liuxin
 * 2023.12.18
 */
@Component
@Slf4j
public class ProductTask {

    @Autowired
    private ProductFeignClient productFeignClient;

    /**
     * 定时任务将点播商品详情存入数据库
     * @param str
     * @return
     */
    @XxlJob("addVodProductClickJob")
    public ReturnT<String> addVodProductClickJob(String str) {
        log.info("---------定时任务将点播商品详情存入数据库开始：--------" + BaseDateTime.getLongDateTimeString(new Date()));
        productFeignClient.addVodProductClickJob();
        log.info("---------定时任务将点播商品详情存入数据库结束：--------" + BaseDateTime.getLongDateTimeString(new Date()));
        return ReturnT.SUCCESS;
    }
}
